package com.testfileupload.uploadimg.design.combination.optimization;

import java.util.ArrayList;

public class Branch implements IBranch{
    //保存子节点
    private ArrayList<ICorp> subordinateList = new ArrayList();
    //树枝节点的名称
    private String name = "";
    //树枝节点的职位
    private String position = "";
    //树枝节点的薪水
    private int salory = 0;

    public Branch(String name, String position, int salory) {
        this.name = name;
        this.position = position;
        this.salory = salory;
    }

    @Override
    public void addSubordinate(ICorp corp) {
        this.subordinateList.add(corp);
    }

    @Override
    public ArrayList<ICorp> getSubordinate() {
        return this.subordinateList;
    }

    @Override
    public String getInfo() {
        String info = "";
        info = "名称：" + this.name;
        info = info + "职位" + this.position;
        info = info + "薪水" + this.salory;
        return info;
    }
}
